<template>
  <div class="top-header">
      <!-- 左侧返回键 -->
 <div class="is-left" v-show="isLeft">
     <a-icon type="left" @click="$router.go(-1)"/>
 </div>
 <!-- 中间的标题 -->
 <div>
     <h1 class="header-title">{{title}}</h1>
 </div>
  </div>
</template>

<script>
export default {
   props:{
       title:{
   type:String,
   require:true
       },
       isLeft:{
    type:Boolean,
    default:false
       }
   }
}

</script>
<style lang="scss" scoped>
.top-header {
  align-items: center;
  background-color:$milk-tea-color;
  box-sizing: border-box;
  color: white;
  padding: $common-padding;
  height: 4rem;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0px 5px 2px rgba($color: #ccc, $alpha: 0.1);
  div {
    flex-grow: 1;
    .header-title {
      margin: 0px;
      font-size: 1.5rem;
      font-weight: bolder;
      color:white;
    }
  }
}
</style>